﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _06继承与多态案例
{
    /// <summary>
    /// 机枪
    /// </summary>
    class MachineGun : Weapon
    {
        public MachineGun(string name, int mc, int an, float fireRate, float dis) : base(name, mc, an, fireRate, dis)
        {
        }

        public override void Fire()
        {
            base.Fire();
            if (AmmoNumInMc > 5)
                AmmoNumInMc -= 5;
            else
                AmmoNumInMc = 0;

            if (_totalAmmoNum > 5)
                _totalAmmoNum -= 5;
            else
                _totalAmmoNum = 0;
            Console.WriteLine("机关枪开火,一串子弹发射出去!");
            PrintWeaponStatus();
        }
    }
}
